import React, { Component } from "react";
import { Card, Button } from "antd";
import { connect } from "dva";

@connect(({ puzzlecards }) => ({
  ...puzzlecards
}))
export default class Puzzlecards extends Component {
  componentDidMount() {
    this.props.dispatch({ type: "puzzlecards/queryInitCards" });
  }
  render() {
    const { data, onClickAdd = () => {} } = this.props;
    return (
      <div>
        {data.map(card => (
          <Card key={card.id}>
            <div>Q: {card.setup}</div>
            <div>
              <strong>A: {card.punchline}</strong>
            </div>
          </Card>
        ))}
      </div>
    );
  }
}
